package com.ZeroCarbon.domain.po;

import cn.hutool.core.bean.BeanUtil;
import com.ZeroCarbon.domain.dto.ReplyDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 回复评论类
 *
 * @since 2024-11-1
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Reply {
    /**
     * 评论id
     */
    private String id;

    /**
     * 回复评论id
     */
    private String replyId;

    /**
     * 评论内容
     */
    private String content;

    /**
     * 点赞数量
     */
    private int liked;

    /**
     * 发布评论
     */
    private LocalDateTime day;

    /**
     * PO转ReplyDTO
     */
    public ReplyDTO toReplyDTO() {
        return BeanUtil.copyProperties(this, ReplyDTO.class);
    }
}
